"""Authentication context processors.

Context processors are called automatically to add variables to the template
context.
"""

def auth(request):
    if hasattr(request, 'user'):
        user = request.user
    else:
        user = None
    return {
        'user': user,
    }
